package com.fla.shapeevader.ui.drawers;

import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.RectF;
import android.graphics.Paint.Style;

import com.fla.shapeevader.model.BaseShape;

public class RectDrawer extends BaseShapeDrawer {

    public RectDrawer(BaseShape shape, int color) {
        super(shape, color);
    }
    
    public boolean checkIntersection(BaseShapeDrawer otherShape) {
        return RectF.intersects(shape.getBounds(), otherShape.getShape().getBounds());
    }

    public void drawOnCanvas(Canvas canvas) {
        Paint paint = new Paint();
        paint.setStrokeWidth(3);
        paint.setStyle(Style.FILL);
        paint.setColor(color);

        canvas.drawRect(shape.getBounds(), paint);
    }

}
